#include "gtest/gtest.h"
#include "List02.hpp"
#include <vector>
using namespace std;

TEST(insertTest, example)
{
	int arr[] = {1, 2, 3, 4, 5 };
	List<int> lst(arr, arr + sizeof(arr) / sizeof(int));
	List<int>::iterator pos;

	pos = lst.begin();
	++pos;

	pos = lst.insert(pos, 10);
	EXPECT_EQ(*++pos, 2);

	lst.insert(pos, 2u, 20);
	EXPECT_EQ(lst.size(), 8u);
	EXPECT_EQ(*--pos, 20);
	
	vector<int> vec(2u, 30);
	lst.insert(pos, vec.begin(), vec.end());
	EXPECT_EQ(lst.size(), 10u);
	EXPECT_EQ(*pos, 20);
	EXPECT_EQ(*--pos, 30);
}
